<?php
require_once 'config.php';
require_once 'NamespaceMap.php' ;
date_default_timezone_set('Asia/Taipei');
session_start();
if(isset($_SERVER["PATH_INFO"]))
{
	$path=explode('.',$_SERVER["PATH_INFO"],2);
	if(strlen($path[0])>2)
	{
		$class=$webnamespace.str_replace('/',"\\",$path[0]);
	}
	else
	{
		$class="{$webnamespace}\\{$webdefaultclass}";
	}
	if(class_exists($class))
	{
		new $class();
	}
	else
	{
		header("HTTP/1.0 404 Not Found");
		header("Status: 404 Not Found");
	}
}
else
{
	header("Location: {$_SERVER['PHP_SELF']}/{$webdefaultclass}.html");
}
